<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.yaodian100.crm.workflow.entity.WorkFlowNode" %>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<c-rt:if test="${!empty param.id}">
<c-rt:set var="cqt" value="${pu:get('com.yaodian100.crm.cs.entity.CommonQuestionType', param.id)}"/>

</c-rt:if>
${pu:criteriaForName('com.yaodian100.crm.workflow.entity.WorkFlow') }
${pu:criteriaAddOrder(pu:criteriaOrderAsc('name')) }
<c-rt:set var="wos" value="${pu:criteriaResult(null)}"/>
<script>
$(document).ready(function(){
	$('#submit_button').click(function(){
		var form;

		doAR('<%=application.getContextPath() %>/cs/updateCommonQuestionType.do', 'rightSide', 'theForm', function(){
			doAR('<%=application.getContextPath() %>/cs/page.do?iamlazy=questionClassLeftSide&focused=${param.parentId}','leftSide', form)
			}
			);
	});
});
</script>
<c-rt:if test="${empty param.id &&  empty param.parentId}">
<h1>建立问题分类大类</h1>
</c-rt:if>
<c-rt:if test="${param.operation=='saved'}">
已储存异动
</c-rt:if>
<form method="post" id="theForm" name="theForm">
<input type="hidden" name="operation" value="saved"/>
<input type="hidden" name="parentId" value="${param.parentId }"/>
<table class="tb-data" width="100%">
<tr><th width="130px">ID</th><td>${cqt.id}<input type="hidden" name="id" value="${cqt.id }"/></td></tr>
<tr><th width="130px">名称</th><td><input type="text" name="name" value="${cqt.name }"/></td></tr>
<tr><th width="130px">描述</th><td><input type="text" name="description" value="${cqt.description }"/></td></tr>
<tr><th width="130px">流程名称</th><td>
<select name="workFlowName">
	<option value="">请选择</option>
	<c-rt:forEach items="${wos }" var="wo">
		<option value="${wo.name }" <c-rt:if test="${wo.name==cqt.workFlowName }">selected="selected"</c-rt:if>>${wo.description }</option>
	</c-rt:forEach>
</select>
</td></tr>
<tr>
<th>是否显示在前台会员问答</th>
<td>
<c-rt:set var="isShowOnQAA" value="true"/>
<c-rt:if test="${!empty cqt.showOnQAA}">
	<c-rt:set var="isShowOnQAA" value="${cqt.showOnQAA }"/>
</c-rt:if>
<input type="radio" name="showOnQAA" value="true" <c-rt:if test="${isShowOnQAA=='true' }">checked="checked"</c-rt:if>/>是<input name="showOnQAA" type="radio" value="false" <c-rt:if test="${isShowOnQAA=='false' }">checked="checked"</c-rt:if>/>否
</td>
</tr>
	<tr>
	<th></th><td><input type="button" id="submit_button" value="送出"/>
	<input type="reset" value="重设"/>
	</td>
	</tr>
	
	</table>
</form>
	